<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="<%=basePath %>Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<title>万达营销流程管理系统</title>
<link href="<%=basePath %>css/css.css" rel="stylesheet" type="text/css" />
<%-- <script src="<%=basePath %>Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="<%=basePath %>Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="<%=basePath %>Scripts/IndexManager.js" type="text/javascript"></script>
<script src="<%=basePath %>Scripts/selectProject.js" type="text/javascript"></script> --%>
 <script type="text/javascript">
        function openWin() {

            showModalDialog("WorkingTimeUpdateManager.htm", "example04", "dialogWidth:600px;dialogHeight:300px;dialogLeft:200px;dialogTop:150px;center: yes;help:yes;resizable:yes;status:yes")
        }

    </script>
<script type="text/javascript">
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
</script>
<script>
<!--
/*第一种形式 第二种形式 更换显示样式*/
function setTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("con_"+name+"_"+i);
menu.className=i==cursel?"hover":"";
con.style.display=i==cursel?"block":"none";
}
}
//-->

</script>
</head>
<body>
<div class="yboxwidth boxcenter ybox01">
  <div class="ybox09">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="ybox10td1"><a href="#"><img src="<%=basePath %>images/op8_1.gif" width="28" height="54" /></a></td>
        <td><table border="0" cellspacing="0" cellpadding="0">
          <tr valign="top">
            <td class="ybox11td1"></td>
            <td class="ybox11td2"><a href="#">1、填写基本信息</a></td>
            <td class="ybox11td8"></td>
            <td class="ybox11td6"><a href="#">2、选择房间</a></td>
            <td class="ybox11td7"></td>
            <td class="ybox11td2"><a href="#">3、导入价格</a></td>
            <td class="ybox11td3"></td>
            <td class="ybox11td2"><a href="#">4、引入折扣方案</a></td>
            <td class="ybox11td3"></td>
            <td class="ybox11td2"><a href="#">5、引入付款方式</a></td>
            <td class="ybox11td3"></td>
            <td class="ybox11td2"><a href="#">6、预览并提交</a></td>
            <td class="ybox11td4"></td>
          </tr>
        </table></td>
        <td class="ybox10td1"><a href="#"><img src="<%=basePath %>images/op8_2.gif" width="28" height="54" /></a></td>
      </tr>
    </table>
  </div>
  <div class="ybox02">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="margb4">
      <tr>
        <td class="ybox03td1"></td>
        <td class="ybox03td2"></td>
        <td class="ybox03td3"></td>
      </tr>
      <tr>
        <td class="ybox03td4"></td>
        <td class="ybox03td5"><div class="ybox05 margb8">
          <dl>
            <dt> <strong>【注】</strong>只能包含未开过盘的房间，系统将自动过滤。 </dt>
          </dl>
        </div>
          <div class="ybox07 margb2">
            
      <dl><table border="0" cellspacing="0" cellpadding="0" class="ybox07table">
              <tr align="left">
                <td class="ybox07td1"><img src="<%=basePath %>images/op4_1.gif" /></td>
                <td><a href="alertadd.do?projectid=${projectbean.projectId}">添加房间</a></td>
                <td class="ybox07td2"><img src="<%=basePath %>images/op4_0.gif" /></td>
                <td class="ybox07td1"><img src="<%=basePath %>images/op4_2.gif" /></td>
                <td><a href="#">移除选中房间</a></td>
                <td class="ybox07td2"><img src="<%=basePath %>images/op4_0.gif"  /></td>
                <td class="ybox07td1"><img src="<%=basePath %>images/op4_3.gif" /></td>
                <td><a href="#">移除所有房间</a></td>
                <td class="ybox07td2"><img src="<%=basePath %>images/op4_0.gif" /></td>
              </tr>
          </table></dl></div><table width="100%" border="0" cellpadding="0" cellspacing="1" class="ybox06table">
                <tr>
                  <td class="ybox06td01"> <input name="select_all" id="select_all" type="checkbox" /></td>
                  <td width="30" class="ybox06td01">序号</td>
                  <td class="ybox06td01">项目</td>
                  <td class="ybox06td01">房间</td>
                  <td class="ybox06td01">建筑面积</td>
                  <td class="ybox06td01">套内面积</td>
                  <td class="ybox06td01">计价方式</td>
                  <td class="ybox06td01">建筑面积单价</td>
                  <td class="ybox06td01">套内面积单价</td>
                  <td class="ybox06td01">标准总价</td>
                </tr>
                
                  <c:forEach items="${roomlist}" var="roombean" varStatus="status">
			<tr>
			 <td class="ybox06td03bcenter"><input type="checkbox" name="select_item" id="select_item"  value="${roombean.roomId}"/></td>
				<td class="ybox06td03bcenter">${status.index+1}</td>
				<td class="ybox06td02wleft">${projectbean.projectName}</td>
				<td class="ybox06td02wcenter">${roombean.roomCode}</td>
				<td class="ybox06td02wcenter">${roombean.buildUpArea}</td>
				<td class="ybox06td02wcenter">${roombean.innerArea}</td>
				<td class="ybox06td02wcenter">建筑面积</td>
				<td class="ybox06td02wcenter">${roombean.unitPrice}</td>
				<td class="ybox06td02wcenter">${roombean.innerPrice}</td>
				<td class="ybox06td02wcenter">${roombean.buildUpArea*roombean.unitPrice}</td>
			</tr>
		</c:forEach>
                
              <!--   <tr>
                  <td class="ybox06td02wcenter"><input type="checkbox" name="checkbox" id="checkbox" /></td>
                  <td class="ybox06td02wcenter">1</td>
                  <td class="ybox06td02wleft">银川西夏万达广场 </td>
                  <td class="ybox06td02wleft">城市商业街-1-101 </td>
                  <td class="ybox06td02wcenter">162.74 </td>
                  <td class="ybox06td02wcenter">154.38 </td>
                  <td class="ybox06td02wcenter">建筑面积</td>
                  <td class="ybox06td02wcenter">0.00</td>
                  <td class="ybox06td02wcenter">0.00</td>
                  <td class="ybox06td02wcenter">0.00</td>
                </tr>
                -->
              </table>
          <div class="nums boxcenter black12"><a href="#" class="hovera">首 页</a><a href="#">上一页</a><a href="#">下一页</a><a href="#">尾 页</a>&nbsp;&nbsp;&nbsp;第1/3页&nbsp;&nbsp;&nbsp;每页&nbsp;
            <input name="textfield3" type="text" id="textfield" size="2"/>
  &nbsp;条/共25条&nbsp;&nbsp;转到&nbsp;
  <input name="textfield3" type="text" id="textfield" size="2"/>
  &nbsp;页<a href="#">跳 转</a></div></td>
        <td class="ybox03td6"></td>
      </tr>
      <tr>
        <td class="ybox03td7"></td>
        <td class="ybox03td8"></td>
        <td class="ybox03td9"></td>
      </tr>
    </table>
    <table width="380" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="60" align="center"><a href="javascript:history.go(-1)"><img src="<%=basePath %>images/botton01.gif" width="95" height="34" /></a></td>
        <td align="center"><a href="goprice.do?projectid=${projectbean.projectId}"><img src="<%=basePath %>images/botton02.gif" width="95" height="34" /></a></td>
      </tr>
    </table>
    
   <script type="text/javascript">
			
                var Ptr = document.getElementById("tab").getElementsByTagName("tr");
                function pageLoad() {
                    for (i = 1; i < Ptr.length + 1; i++) {
                        Ptr[i - 1].className = (i % 2 > 0) ? "t1" : "t2";
                    }
                }
                window.onload = pageLoad;
                for (var i = 0; i < Ptr.length; i++) {
                    Ptr[i].onmouseover = function () {
                        this.tmpClass = this.className;
                        this.className = "t3";

                    };
                    Ptr[i].onmouseout = function () {
                        this.className = this.tmpClass;
                    };
                }
//-->
//序号
window.onload=function(){
	var oTable = document.getElementById("tab");
	for(var i=0;i<oTable.rows.length;i++){
		oTable.rows[i].cells[1].innerHTML=(i+1);
	}
}
//条件查询
$(function(){
	$("#selectpn").click(function(){
		var a = $("#projectname").val();
		window.location.href="selectall.do?projectname="+a;
	});
});
//删除
var arr = new Array();
$(function(){  
    $("#delete").click(function() {
    	var a = confirm("确认删除？");
    	if(a){
    		 $("input[name='select_item']:checked").each(function() { // 遍历选中的checkbox
    	            n = $(this).parents("tr").index();  // 获取checkbox所在行的顺序
    	            alert(n);
    	            window.alert($(this).val());
    	            arr.push($(this).val());
    	      });
    		 window.location.href="deletebyprimarykey.do?buildIdArray="+arr;
    	}
    });
});
//修改
$(function(){  
    $("#update").click(function() { 
    		 var a=$(':checked').length;
    		 alert(a);
    		 var buildId=$("input[name='select_item']:checked").val();
    		 alert(buildId);
    		 if(a==1){
	            	window.location.href="selectone.do?buildId="+buildId;	
	            }else{
	            	window.alert("您选中的行数大于1或小于，请选择一行进行修改");
	            }
    });
});
//全选，全不选
  var checkboxes = document.getElementsByName('select_item');
 
              $("#select_all").click(function() {
              alert(1);
                  for (var i = 0; i < checkboxes.length; i++) {
                      var checkbox = checkboxes[i];
                      if (!$(this).get(0).checked) {
                          checkbox.checked = false;
                      } else {
                          checkbox.checked = true;
                      }
                  }
              });
              
       //单个选中
            $('#tb1 tbody').on('click', "input", function() {
            var rowObj=dataExample.row($(this).closest("tr"));
            	alert("1111");
                var checkbox = document.getElementById(rowObj.data().tbid);
                if(checkbox.checked==true){
                    checkbox.checked=false
                }else{
                    checkbox.checked=true 
                }
            });
           
            </script>   
    
  </div>
</div>
</body>
</html>
